package com.huarui.partner.action;



import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONObject;

import org.ewaf.framework.action.BaseAction;
import org.ewaf.framework.util.HttpUtil;

import com.huarui.partner.model.Partner;
import com.huarui.partner.service.PartnerService;

public class PartnerValidateAction extends BaseAction{

	private static final long serialVersionUID = -4457592422231975088L;

	private PartnerService partnerService;

	public void setPartnerService(PartnerService partnerService) {
		this.partnerService = partnerService;
	}
	
	public String checkPartnerName() throws IOException {
//		HttpServletResponse resp = HttpUtil.getResponse();
		PrintWriter out = HttpUtil.getPrintWrite();
		HttpServletRequest res = HttpUtil.getRequest();
		String name = res.getParameter("name");
//		System.out.println("name: = " + name);
		JSONObject jo = new JSONObject();
//		if(this.partnerService.validatePartnerByName(name)) {
//			jo.put("result", "Y");
//		} else {
//			jo.put("result", "N");
//		}
		out.print(jo.toString());
		out.flush();
		out.close();
		return null;
	}
}
